home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NetNews Offline 2
/
NetNews Offline Volume 2.iso
/
news
/
comp
/
std
/
c
/
323
< prev
next >
Wrap
Internet Message Format
|
1996-08-06
|
1KB
Path: ix.netcom.com!netnews
From: miker3@ix.netcom.com (Mike Rubenstein)
Newsgroups: comp.std.c
Subject: Re: A question about: #define
Date: Mon, 12 Feb 1996 12:25:02 GMT
Organization: Netcom
Message-ID: <311f3104.236842591@nntp.ix.netcom.com>
References: <qug2cgc3xo.fsf@chivas.eua.ericsson.se>
NNTP-Posting-Host: ix-dc10-11.ix.netcom.com
X-NETCOM-Date: Mon Feb 12 4:24:48 AM PST 1996
X-Newsreader: Forte Agent .99d/32.182
tobbe@erix.ericsson.se (Torbj|rn T|rnkvist) wrote:
>
> I'm wondering if the following preprocessor directive is
> permissible in ANSI C ?
>
> #define A #define B
>
> I couldn't see from from my Harbison,Steele, "A C Reference Manual",
> if it is ok or not (gcc -ansi -pedantic accept this but the Sun
> ANSI-C compiler does not...).
It depends on what you mean. It's legal to define A like that, but
using A as a macro in your program is not. From ISO 6.8.3.4:
The resulting [from macro expansion] completely macro-replaced
preprocessing token sequence is not processed as a
preprocessing directive even if it resembles one.
Michael M Rubenstein